/* 基本样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 导航栏样式 */
header {
    background-color: #333;
    padding: 1rem;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    margin-right: 1rem;
}

nav a:hover {
    background-color: #555;
    border-radius: 4px;
}

/* 主要内容区域 */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* 消息样式 */
.messages {
    margin-bottom: 1rem;
}

.message {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

.battle-container {
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    gap: 20px;
    padding: 20px;
    height: 100vh;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hp-bar {
    width: 200px;
    height: 20px;
    background: #ddd;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.hp-fill {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s ease;
}

.battle-area {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.monster-info {
    text-align: center;
}

.action-area {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.action-btn, .skill-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.action-btn {
    background: #4CAF50;
    color: white;
}

.skill-btn {
    background: #2196F3;
    color: white;
}

.battle-log {
    height: 150px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
}

.battle-log li {
    margin-bottom: 5px;
    list-style: none;
}

/* 主页样式 */
.home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.character-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.character-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 60px;
    object-fit: cover;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.stat-item {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.stat-label {
    display: block;
    color: #666;
    font-size: 0.9em;
}

.stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.main-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.action-button {
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s;
}

.action-button:hover {
    transform: translateY(-2px);
}

.start-game { background: #4CAF50; }
.upgrade { background: #2196F3; }
.collection { background: #9C27B0; }

/* 升级界面样式 */
.upgrade-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.resource-bar {
    background: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.resource {
    display: flex;
    align-items: center;
    gap: 10px;
}

.upgrade-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.upgrade-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.current-value {
    margin: 15px 0;
    font-size: 1.1em;
}

.next-value {
    color: #4CAF50;
    margin-left: 10px;
}

.upgrade-btn {
    width: 100%;
    padding: 10px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.upgrade-btn:hover {
    background: #1976D2;
}

.skills-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.skill-card {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    position: relative;
}

.skill-card.equipped {
    border: 2px solid #4CAF50;
}

.skill-level {
    margin: 10px 0;
    color: #666;
}

.skill-upgrade-btn {
    width: 100%;
    padding: 8px;
    background: #9C27B0;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.monster-container img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin: 10px 0;
    image-rendering: pixelated;  /* 像素风格游戏可以添加这个属性 */
}

.monster-container {
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
} 